//导入 vue
import Vue from "vue";

// 关闭提示
Vue.config.productionTip = false;

// 导入 App 根组件
import App from "./App"

// 导入路由
import router from "./router";

// 导入 store
import store from "@/store"

// 注册全局组件
import TypeNav from "@/components/TypeNav"
import Pagination from "@/components/Pagination"
Vue.component("TypeNav",TypeNav)
Vue.component("Pagination",Pagination)

//完整导入 elementui
// import ElementUI from 'element-ui';
// import 'element-ui/lib/theme-chalk/index.css';
// Vue.use(ElementUI);

//按需导入 elementui
import { Button ,Loading,MessageBox,Message} from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// Vue.component(Button.name, Button);
Vue.use(Button)

// 懒加载图片包
import VueLazyload from 'vue-lazyload'
import loading from "@/assets/1.gif"
Vue.use(VueLazyload,{
    loading
})



import "@/utils/validate"



Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$message = Message;


// 导入 mock
import "@/mock"

// 实例化对象
new Vue({
    el:"#app",
    router,
    store,
    beforeCreate(){
        Vue.prototype.$bus = this;
    },
    render: h => h(App)
})